clear all;clc;tic;
omega=1.5;
x=linspace(0,3,30); y=linspace(0,2,20);
phi(:,30)=sin(3*pi/2*y)';
phi(20,:)=(sin(pi*x).*cos(pi/3*x));
for N=1:100
    for i=2:19
        for j=2:29
            ph=phi(i+1,j)+phi(i-1,j)+phi(i,j+1)+phi(i,j-1);
            phi(i,j)=(1-omega)*phi(i,j)+0.25*omega*(ph);
        end
    end
end
% colormap([0.5,0.5,0.5]);
surfc(phi)
toc